/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gradesjunit;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author x00104195
 */
public class GradesJUnitTest {
    
    public GradesJUnitTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    /**
     * Test of main method, of class GradesJUnit.
     */
    //@Test
    public void testMain() {
        System.out.println("main");
        String[] args = null;
        GradesJUnit.main(args);
        // TODO review the generated test code and remove the default call to fail.
        fail("The test case is a prototype.");
    }

    /**
     * Test of grade method, of class GradesJUnit.
     */
    @Test
    public void testGrade() {
        //Preconditions
        System.out.println("grade");
        int exam = 50;
        int ca = 30;
        String expResult = "Component Fail";
        //Exercise
        String result = GradesJUnit.grade(exam, ca);
        //Postcondition
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
    }
    
    @Test
    public void testGrade2() {
        //Preconditions
        System.out.println("grade");
        int exam = 41;
        int ca = 39;
        String expResult = "Component Fail";
        //Exercise
        String result = GradesJUnit.grade(exam, ca);
        //Postcondition
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
    }
    @Test
    public void testGrade3() {
        //Preconditions
        System.out.println("grade");
        int exam = 81;
        int ca = 100;
        String expResult = "Pass with Distinction";
        //Exercise
        String result = GradesJUnit.grade(exam, ca);
        //Postcondition
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
    }
      @Test
    public void testGrade4() {
        //Preconditions
        System.out.println("grade");
        int exam = 60;
        int ca = 60;
        String expResult = "Pass";
        //Exercise
        String result = GradesJUnit.grade(exam, ca);
        //Postcondition
        assertEquals(expResult, result);
        // TODO review the generated test code and remove the default call to fail.
    }

    /**
     * Test of computeFine method, of class GradesJUnit.
     */
    @Test
    public void testComputeFine1() {
        System.out.println("computeFine");
        String vehicle = "Bus";
        int speed = 70;
        int zone = 20;
        String expResult = "EUR 0";
        String result = GradesJUnit.computeFine(vehicle, speed, zone);
        assertEquals(expResult, result);
    }
    
     @Test
    public void testComputeFine2() {
        System.out.println("computeFine");
        String vehicle = "Car";
        int speed = 50;
        int zone = 30;
        String expResult = "EUR 50";
        String result = GradesJUnit.computeFine(vehicle, speed, zone);
        assertEquals(expResult, result);
    }
     
      @Test
    public void testComputeFine3() {
        System.out.println("computeFine");
        String vehicle = "Car";
        int speed = 65;
        int zone = 30;
        String expResult = "EUR 80";
        String result = GradesJUnit.computeFine(vehicle, speed, zone);
        assertEquals(expResult, result);
    }
      
       @Test
    public void testComputeFine4() {
        System.out.println("computeFine");
        String vehicle = "Bus";
        int speed = 60;
        int zone = 30;
        String expResult = "EUR 80";
        String result = GradesJUnit.computeFine(vehicle, speed, zone);
        assertEquals(expResult, result);

    }
       
        @Test
    public void testComputeFine5() {
        System.out.println("computeFine");
        String vehicle = "Car";
        int speed = 60;
        int zone = 50;
        String expResult = "EUR 100";
        String result = GradesJUnit.computeFine(vehicle, speed, zone);
        assertEquals(expResult, result);

    }
}